package com.entity;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the FUNCTION_ database table.
 * 
 */
@Entity
@Table(name="FUNCTION_")
@NamedQuery(name="Function.findAll", query="SELECT f FROM Function f")
public class Function implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="FUNCTION__FUNCTIONID_GENERATOR", sequenceName="SEQ",initialValue=1,allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="FUNCTION__FUNCTIONID_GENERATOR")
	@Column(name="FUNCTION_ID")
	private long functionId;

	@Column(name="FUNCTION_EXPLAIN")
	private String functionExplain;

	@Column(name="FUNCTION_IFDELETE")
	private BigDecimal functionIfdelete;

	@Temporal(TemporalType.DATE)
	@Column(name="FUNCTION_INTODATE")
	private Date functionIntodate;

	@Column(name="FUNCTION_NAME")
	private String functionName;

	//bi-directional many-to-one association to Functionalclassify
	@ManyToOne
	@JoinColumn(name="FUNCTIONALCLASSIFY_ID")
	private Functionalclassify functionalclassify;

	//bi-directional many-to-many association to Role
	@ManyToMany(mappedBy="functions")
	@JSONField(serialize=false)
	private List<Role> roles;
	
	//分类名称id
	@Transient
	private Long functionalclassifyId;
	
	public Long getFunctionalclassifyId() {
		return functionalclassifyId;
	}

	public void setFunctionalclassifyId(Long functionalclassifyId) {
		this.functionalclassifyId = functionalclassifyId;
	}

	public Function() {
	}

	public long getFunctionId() {
		return this.functionId;
	}

	public void setFunctionId(long functionId) {
		this.functionId = functionId;
	}

	public String getFunctionExplain() {
		return this.functionExplain;
	}

	public void setFunctionExplain(String functionExplain) {
		this.functionExplain = functionExplain;
	}

	public BigDecimal getFunctionIfdelete() {
		return this.functionIfdelete;
	}

	public void setFunctionIfdelete(BigDecimal functionIfdelete) {
		this.functionIfdelete = functionIfdelete;
	}

	public Date getFunctionIntodate() {
		return this.functionIntodate;
	}

	public void setFunctionIntodate(Date functionIntodate) {
		this.functionIntodate = functionIntodate;
	}

	public String getFunctionName() {
		return this.functionName;
	}

	public void setFunctionName(String functionName) {
		this.functionName = functionName;
	}

	public Functionalclassify getFunctionalclassify() {
		return this.functionalclassify;
	}

	public void setFunctionalclassify(Functionalclassify functionalclassify) {
		this.functionalclassify = functionalclassify;
	}

	public List<Role> getRoles() {
		return this.roles;
	}

	public void setRoles(List<Role> roles) {
		this.roles = roles;
	}

}